package com.sanhe.roller.activity.work;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.MenuProvider;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;

import com.menu.app.MyApp;
import com.sanhe.roller.databinding.ActivityModeBinding;
import com.sanhe.roller.util.Const;

public class ModeActivity extends BaseWorkActivity {

    ActivityModeBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityModeBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        binding.mode1.setOnClickListener(v -> {
            Const.mode = 1;
            Intent i = new Intent(ModeActivity.this, WorkActivity.class);
            startActivity(i);
        });

        binding.mode2.setOnClickListener(v -> {
            Const.mode = 2;
            Intent i = new Intent(ModeActivity.this, WorkActivity.class);
            startActivity(i);
        });

        binding.mode3.setOnClickListener(v -> {
            Const.mode = 3;
            Intent i = new Intent(ModeActivity.this, WorkActivity.class);
            startActivity(i);
        });

        binding.mode4.setOnClickListener(v -> {
            Const.mode = 4;
            Intent i = new Intent(ModeActivity.this, WorkActivity.class);
            startActivity(i);
        });

        binding.back.setOnClickListener(v -> finish());
    }

    @Override
    protected void onResume() {
        super.onResume();
        MyApp.getApp().setIgnore(false);
    }

    @Override
    public void addMenuProvider(@NonNull MenuProvider provider, @NonNull LifecycleOwner owner, @NonNull Lifecycle.State state) {

    }
}
